<script lang="ts" setup>
import NewsLive from "@/components/NewsLive/index.vue";
import WinDetail from "./components/WinDetail.vue";
import useChkNum from "../hooks/useChkNum";
import LotStats from "./components/LotStats.vue";
import ViewNumbers from "./components/ViewNumbers.vue";
import useFetchHome, { useFetchHomeRefs } from "../hooks/useFetchHome";
const { handleDrawVidClick } = useChkNum();
const { fetchHomeData } = useFetchHome();
const { resItem, draw_video } = useFetchHomeRefs();
onMounted(() => {
  fetchHomeData();
});
console.log(resItem);
</script>
<template>
  <div>
    <WinDetail :res-item="resItem" />
    <div class="w-362 mx-auto">
      <LotStats />
      <ViewNumbers />
      <Player
        @click="handleDrawVidClick"
        class="mb-4"
        :options="{
          youtubeId: (draw_video && draw_video.match(/v=([^&]+)/)?.[1]) || '',
          className: 'rounded-[10px_10px_0_0]'
        }"
      />
      <div class="py-16">
        <NewsLive />
      </div>
    </div>
  </div>
</template>
